package com.smarttiger.zero.admin.dao;

import com.smarttiger.zero.admin.entity.ArgsModel;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface ArgsDao extends BaseDao<ArgsModel> {

    @Query("select es from ArgsModel es where es.logicId = ?1 ORDER BY es.createDate ")
    public List<ArgsModel> findAllByLogicId(String logicId);

    @Modifying
    @Query("delete from ArgsModel es where es.logicId = ?1")
    public void deleteByLogicId(String logicId);
}
